package com.yunao.dao;

import com.yunao.entity.Subject;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface SubjectRepository extends JpaRepository<Subject,Integer> {
    List<Subject> findByUserId(Integer userId);

    List<Subject> findByUserIdAndParentidAndSubjectType(Integer userId, Integer parentid, Integer subjectType);

    List<Subject> findByOrganId(Integer OrganId);

    List<Subject> findByParentidAndSubjectType(Integer parentid, Integer subjectType);

    Subject findBySubjectName(String subjectName);

    Subject findByUserIdAndSubjectName(Integer userid,String subjectName);

    List<Subject> findByUserIdAndNeedAlarm(Integer userId, Integer needAlarm);

    List<Subject> findByUserIdAndAlarmPeriodIsNotNull(Integer userId);

    List<Subject> findByUserIdAndIshome(Integer userid, Integer ishome);

    List<Subject> findByNeedAlarm(Integer need);
}
